MOOC Utils

Utils like auto assignment solver extension and course notice announcment notification for MOOC courses

Technology stack

What each package actually uses.

  • Assignment Solver: JavaScript, Vite 5.4, webextension-polyfill 0.12, Gemini over fetch.
  • Notice Reminders: Python 3.12+, FastAPI 0.110+, Tortoise ORM 0.20+, HTTPX 0.27+.
  • Website: Next.js 16.1.6, React 19.2.3, TanStack Query 5.90, Tailwind 4.

Project structure#

The extension does not depend on Notice Reminders.

Browser extension (assignment solver)#

  • Build: Vite 5.4.x
  • Polyfill: webextension-polyfill 0.12.x
  • Manifest: Vite plugin writes Chrome vs Firefox manifest.json
  • Gemini: https://generativelanguage.googleapis.com/v1beta/models from src/services/gemini/index.js
  • Package name: nptel-assignment-solver 1.1.0

Chrome uses side_panel and a service worker. Firefox uses sidebar_action and a script background. Shared content scripts target NPTEL-style pages.

Backend API (notice reminders)#

  • Python 3.12+ (requires-python = ">=3.12")
  • FastAPI, Uvicorn, Tortoise, Aerich, HTTPX, BeautifulSoup, Pydantic Settings, PyJWT
  • Default database_url: sqlite://./data/db/db.sqlite3
  • CORS: http://localhost:3000
  • OTP: otp_delivery defaults to console
  • Hatchling wheel of the app package
  • Scripts: notice-reminders = "main:main"

Website (Next.js)#

  • Next.js 16.1.6, React 19.2.3, TypeScript 5
  • Tailwind CSS 4 with @tailwindcss/postcss
  • TanStack React Query 5.90
  • PostHog JS 1.358
  • Base UI / shadcn
  • Scripts: build and lint only for day-to-day work. Do not use npm run dev or bun dev.

Architecture overview#

Gemini is called from the extension, not from FastAPI.

Assignment solver architecture#

Messages between UI, background, and content script. Dynamic manifests for Chrome and Firefox.

Notice reminders API#

Routers live in app/api/routers/. CLI lives in app/cli.

Website frontend architecture#

The website API client is fetch in lib/api.ts, not HTTPX.

Dependency analysis#

Performance#

Vite for extension rebuilds. Tortoise stays async. HTTPX plus a 60 minute cache on Swayam searches. Next.js splits routes. Tailwind 4 through PostCSS.

Chrome vs Firefox: Manifest v3, polyfill, generated manifests, side_panel vs sidebar_action.

Troubleshooting#

  • Manifest generation: Vite mode chrome or firefox, then load the matching dist/ folder.
  • Gemini quota: wait, shrink the batch, check AI Studio.
  • Aerich vs a fresh SQLite file: delete data/db/db.sqlite3 only in local throwaway work.
  • CORS: frontend origin must be in cors_origins.
  • Website types: bun run build / bun run lint. Set NEXT_PUBLIC_API_URL.

Conclusion#

Current stack on purpose. Swap a library only inside the package that owns it.